//
//  XFChoseDiseaseViewController.m
//  名医通
//
//  Created by zyc on 16/7/12.
//  Copyright © 2016年 mr.zhou. All rights reserved.
//

#import "XFChoseDiseaseViewController.h"
#import "XFNetWorkManager.h"
#import "XFModelTaibleViewController.h"

@interface XFChoseDiseaseViewController ()

@property (nonatomic,strong) NSArray *diseaseArray;


@end

#define diseaseChoseID @"disaeseChoseIndentifier"

@implementation XFChoseDiseaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

#pragma mark - tableView代理方法

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    self.didSelecetdRow(self.diseaseArray[indexPath.row] , indexPath.row + 1);
    
    [self.navigationController popViewControllerAnimated:YES];
    
   

}



#pragma mark - Table view data source


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    
    return self.diseaseArray.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:diseaseChoseID];
    
    if (cell == nil) {
    
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:diseaseChoseID];
        
    }
    /**
     设置title文字
     */
    cell.textLabel.text = self.diseaseArray[indexPath.row];
    /**
     右边的箭头
    */
    UIImageView *arrowView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"login_step"]];
    
    arrowView.frame = CGRectMake(0, 0, 15, 20);
    
    cell.accessoryView = arrowView;
    
    return cell;

}


#pragma mark - 疾病数组懒加载
-(NSArray *)diseaseArray {
    
    if (_diseaseArray == nil) {
    
        _diseaseArray = [NSArray arrayWithObjects:@"肿瘤",@"血液病",@"心脑血管病",@"神经系统",@"骨科", nil];
    
    }
    return _diseaseArray;
}


@end
